/*
 * @Description:信息框
 * @Author: maskMan
 * @LastEditTime: 2024-03-02 15:57:28
 */
import { MARK } from '../define/variable'
import { playEffect } from './shorts'
const { ccclass, property } = cc._decorator
@ccclass
export class Msg extends cc.Component {
  @property(cc.Label)
  tips_label: cc.Label = null
  @property(cc.Node)
  btn_Node: cc.Node = null
  tipTxt: string = ''
  isSingle = true
  onLoad() {
    this.tips_label.string = this.tipTxt
    if (this.isSingle) {
      this.btn_Node.children[0].active = true
    } else {
      this.btn_Node.children[0].active = true
      this.btn_Node.children[1].active = true
    }
  }
  /**确定点击 */
  onQueClick(e) {
    playEffect('btn')
    this.node.destroy()
    this.node.emit(MARK.NODE_EVENT, true)
  }
  /**取消点击 */
  onCancelClick(e) {
    playEffect('btn')
    this.node.destroy()
    this.node.emit(MARK.NODE_EVENT, false)
  }
  /**窗口销毁 */
  onDestroy() {}
}
